//
//  CompositeObjects.h
//  Charles
//
//  Created by Leo on 2019/7/11.
//  Copyright © 2019 charles. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/**
 表示目录条目的抽象类
 */
@interface Entry : NSObject

- (NSString *)getName;
- (NSInteger)getSize;
- (Entry *)add:(Entry *)entry;
- (void)printList;
- (void)printList:(NSString *)prefix;
- (NSString *)toString;

@end

/**
 文件类
 */
@interface File : Entry

- (instancetype)initWithName:(NSString *)name size:(NSInteger)size;

@end

/**
 目录类
 */
@interface Directory : Entry

- (instancetype)initWithName:(NSString *)name;

@end

NS_ASSUME_NONNULL_END
